"""
Place to play with some rough ideas. May not work.

This code is part of AXE:           /'-./\_
cropping complexity,                :   ||,>
culling confusion,                  \.-'||
and cutting the crap                    ||
since 2012.                             ||  
                                        ||   pjb

(c) 2012, Tim Menzies, tim@menzies.us, LGPL v3.0
"""

def bars(*lst) :
  width = 40
  lo   = min([x[0] for x in lst])
  hi   = max([x[-1] for x in lst])
  norm = lambda n : int(width*(n - lo)/(hi - lo))
  out = []
  for lst1 in lst:
    print lst1
    tmp = [" " for x in range(width)]
    last = lo
    mark = False
    for here in lst1:
      for x in range(norm(last),norm(here)):
        tmp[x] = "*" if mark else "-"
      last = here
      mark = not mark
    out.append(str(lo) + ' ['+ ''.join(tmp) + '] ' + str(hi))
  return '\n'.join(out)
